/**
 * 
 */
package org.insia.smartposse.metier;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import org.insia.smartposse.metier.webservice.LightCategory;

/**
 * @author raguerri
 * @since 18 avr. 07
 * @version 0.0.1
 * 
 */
public class Category 
implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3693532023141820529L;
	private long _id = -1L;
	private String _label;
	private Category _parent;
	private Set<CategoryTheme> _themeSet = new HashSet<CategoryTheme>();	

	/**
	 * Empty constructor.
	 *
	 */
	public Category() {
	}
	
	/**
	 * Getter for the id.
	 * @return the id.
	 */
	public long getId() {
		return _id;
	}
	
	/**
	 * Getter for the label.
	 * @return
	 */
	public String getLabel() {
		return _label;
	}
	/**
	 * Getter for the parent category.
	 * @return the parent category. If there is no parent, it returns null.
	 */
	public Category getParent() {
		return _parent;
	}
	/**
	 * Setter for the id.
	 * @param id the id to set.
	 */
	public void setId(long id) {
		this._id = id;
	}
	/**
	 * Setter for the label.
	 * @param label the label to set.
	 */
	public void setLabel(String label) {
		this._label = label;
	}
	/**
	 * Setter for the parent category.
	 * @param parent the parent category to set.
	 */
	public void setParent(Category parent) {
		this._parent = parent;
	}

	/**
	 * Getter for the set of themes.
	 * @return the set of themes.
	 */
	public Set<CategoryTheme> getThemeSet() {
		return _themeSet;
	}

	/**
	 * Setter for the set of themes.
	 * @param themeSet the set of themes to set.
	 */
	public void setThemeSet(Set<CategoryTheme> themeSet) {
		this._themeSet = themeSet;
	}
	
	/**
	 * 
	 * @return lcate the webservice Category representation
	 */
	public LightCategory setLight() {
		LightCategory lcate = new LightCategory(this);
		return lcate;
	}
}